ADMIN-006: Verify Configuration Page functionality#61908
ADMIN-006: Verify Configuration Page functionality#61908amankum2004 wants to merge 1 commit intoapache:mainfrom
Conversation
|
@vatsrahul1001 Hello sir, I have created this PR to fix the issue - UI E2E Test || ADMIN-006: Verify Configuration Page functionality #60572 |
6132e50 to
a367875
Compare
a367875 to
1cf5383
Compare
Thanks @amankum2004 I will review soon |
| name: process.env.TEST_ASSET_NAME ?? "s3://dag1/output_1.txt", | ||
| }, | ||
| connection: { | ||
| baseUrl: process.env.AIRFLOW_UI_BASE_URL ?? "http://localhost:28080", |
There was a problem hiding this comment.
Why have we removed this?
|
|
||
| public async waitForLoad(): Promise<void> { | ||
| await this.heading.waitFor({ state: "visible", timeout: 30_000 }); | ||
| await this.page.waitForFunction( |
There was a problem hiding this comment.
We can just use
await expect(this.table.or(this.forbiddenStatus)).toBeVisible({ timeout: 30_000 });
| }; | ||
| } | ||
|
|
||
| public async hasSectionAndKey(section: string, key: string): Promise<boolean> { |
There was a problem hiding this comment.
Should use filter
public async hasSectionAndKey(section: string, key: string): Promise<boolean> {
const row = this.rows.filter({ hasText: section }).filter({ hasText: key });
return (await row.count()) > 0;
}
| @@ -112,6 +112,12 @@ Environment variables (with defaults): | |||
| - `TEST_USERNAME` - Username (default: `airflow`) | |||
| - `TEST_PASSWORD` - Password (default: `airflow`) | |||
| - `TEST_DAG_ID` - Test DAG ID (default: `example_bash_operator`) | |||
There was a problem hiding this comment.
Why do we need so many config? I think only TEST_CONFIG_PAGE_EXPECTS_TABLE_DATA might be required
|
@amankum2004 can you look at failing test? |
PR Description: Add E2E Coverage for Configuration Page
Summary
testConfigso tests are reusable across environments.What Changed
ConfigsPagepage object:airflow-core/src/airflow/ui/tests/e2e/pages/ConfigsPage.tsnavigate,waitForLoad, row parsing, section/key matching).airflow-core/src/airflow/ui/tests/e2e/specs/configs.spec.ts403 Forbiddenmessage.testConfig:airflow-core/src/airflow/ui/playwright.config.tsconfigPageoptions:pathexpectedHeadingexpectsTableDataexpectedSectionexpectedKeyforbiddenMessageairflow-core/src/airflow/ui/tests/e2e/README.mdTest Coverage Added
verify configuration displaysverify configuration page is accessible via Admin menuverify configuration section and key are rendered(whenTEST_CONFIG_PAGE_EXPECTS_TABLE_DATA=true)verify section, key and value are populated in configuration rows(whenTEST_CONFIG_PAGE_EXPECTS_TABLE_DATA=true)Acceptance Criteria Mapping
ConfigsPage+ spec uses page object methods).testConfig: Met (testConfig.configPagedrives path and assertions).Notes
/configs(plural).TEST_CONFIG_PAGE_EXPECTS_TABLE_DATA=false(default) validates the403 Forbiddenstate.TEST_CONFIG_PAGE_EXPECTS_TABLE_DATA=trueTEST_CONFIG_PAGE_SECTIONandTEST_CONFIG_PAGE_KEY.